﻿using System;

namespace SapaFinance.Domain.Model
{
    public class BudgetItem : AbstractEntity
    {
        protected BudgetItem() {}

        public BudgetItem(string name)
            : this()
        {
            Name = name;
        }

        public virtual string Name { get; set; }

        public override bool Equals(object obj)
        {
            var compare = (BudgetItem) obj;
            if (ReferenceEquals(null, compare)) return false;
            if (UID != Guid.Empty) return base.Equals(compare);
            return Name.Equals(compare.Name);
        }
    }
}